<?php
if (!defined('W_ROOT')) {
	exit();
}
$star = '<span style="color:red">*</span>';
$errormsg = (isset($_GET['error']) && $_GET['error'] != '') ? $_GET['error'] : '';

$name = $vdo_title = $vdo_ytb_id=$vdo_status =$desc = "";

$sql = "SELECT * FROM ".Tblvdoyoutube::tblvdoyoutube." WHERE ".Tblvdoyoutube::id."=$id LIMIT 1";
$result = mysql_query($sql);
if(dbNumRows($result)){
	$row = mysql_fetch_assoc($result);
	$id = $row[Tblvdoyoutube::id];
	$vdo_title = $row[Tblvdoyoutube::vdo_title];
	$vdo_ytb_id = $row[Tblvdoyoutube::vdo_ytb_id];
	$desc = stripslashes($row[Tblvdoyoutube::vdo_description]);
	$vdo_status = stripslashes($row[Tblvdoyoutube::vdo_status]);
}
?>
<div class="breadcrumb">
        <a href="<?php echo base_url_admin;?>"><?php echo $lang['HOME'];?></a>
         ::<a href="index.php?view=list"><?php echo $lang['MANAGE_VIDEO']; ?></a>
         ::<?php echo $lang['ADD_NEW_VIDEO']; ?>
      </div>
<div class="box">
	<?php if(!empty($errormsg)){?>
			<div class="warning"><?php echo urldecode($errormsg);?></div>
	<?php }?>
<div class="heading">
	<h1><img src="../templates/image/youtube.png" alt="" />
	
			<?php echo $lang['MANAGE_VIDEO']; ?>&nbsp;&nbsp;&nbsp;<span class="required">(*) all asterisks must be required!</span>
	
	</h1>
	<div class="buttons">
	<form action="<?php echo base_url_admin;?>/vdoyoutube/process.php?action=add" method="post" enctype="multipart/form-data" name="frmPage" id="frmPage">
	<input class="button" type="submit" name="btnsave" value="<?php echo $lang['SAVE']; ?>" />						&nbsp;&nbsp;&nbsp;
	<input class="button" type="reset" name="btnreset" value="<?php echo $lang['RESET']; ?>" />&nbsp;&nbsp;&nbsp; 
	<input class="button" type="button" name="btncancel" value="<?php echo $lang['CANCEL']; ?>" onClick="javascript:window.history.back();" />
</div>
</div>
<div class="content" >
<div class="row">
<div class="span6 offset6">
</div>
<table align="center" cellpadding="5" cellspacing="5" width="99%">
	<tr>
	<td align="left" width="120"><?php echo $lang['VDO_TITLE']; ?> <font color="#FF0000">*</font></td>
	<td align="left" width="10">:</td>
	<td align="left"><input   name="txtvdotitle" type="text" size="50" value="<?php echo @$vdo_title;?>" placeholder="Please enter Video Title" /></td>
			
	</tr>
	<tr>
		<td align="left" width="120"><?php echo $lang['VDO_YOUTUBE_ID']; ?> <font
			color="#FF0000">*</font></td>
		<td align="left" width="10">:</td>
		<td align="left"><input name="txtvdoyoutubeid" size="50" type="text"
			value="<?php echo ($vdo_ytb_id)?"http://www.youtube.com/watch?v=".$vdo_ytb_id:"";?>" placeholder="Please enter Youtube ID (http://www.youtube.com/watch?v=ZB8WNFEeGFc" /></td>
	</tr>
	
	<tr>
		<td align="left" valign="top"><?php echo $lang['DISCRIPTION']; ?></td>
		<td valign="top" align="left">:</td>
		<td align="left"><textarea id="txtdesc" name="txtdescription" rows="20" cols="80" style="width: 100%"><?php echo @$desc;?></textarea> 
		<input type="hidden" name="hidid" value="<?php echo @$id;?>" /></td>
	</tr>
	<tr>
		<td align="left" width="120"><?php echo $lang['VDO_STATUS']; ?> <font
			></font></td>
		<td align="left" width="10">:</td>
		<td align="left">
			<select name="CboVdoStatus" style="width:auto">
				<option <?php echo ($vdo_status==1)?"selected":"";?> value="1"><?php echo $lang['ENABLE'];?></option>
				<option <?php echo ($vdo_status==0)?"selected":"";?> value="0"><?php echo $lang['DISABLE'];?></option>
			</select>
		</td>
	</tr>
</table>

</form>
</div><!--<div class="row">-->
</div>
</div>
<script type="text/javascript" src="<?php echo base_url; ?>admin/templates/javascript/ckeditor/ckeditor.js"></script>
<script>
    $(document).ready(function() {
        CKEDITOR.replace('txtdesc', {
            
        });
    });
    $('#tabs a').tabs();
</script>

